﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace SchoolOA.Controllers
{
    public class XZController : Controller
    {
        public IActionResult Index()
        {
            string name = HttpContext.Session.GetString("username");
            string section = HttpContext.Session.GetString("section");
            if (name == null || !section.Equals("xz"))
            {
                return Redirect(Url.Action("ErrorPage", "Home"));
            }
            return View();
        }
        public IActionResult PlanDetail(int id)
        {
            string name = HttpContext.Session.GetString("username");
            string section = HttpContext.Session.GetString("section");
            if (name == null || !section.Equals("xz"))
            {
                return Redirect(Url.Action("ErrorPage", "Home"));
            }
            ViewData["id"] = id;
            return View();
        }
    }
}